<?php
namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Session;
class NewsController extends Controller{

	public $assign = [];
	public function detailsNews($id_news){
                $user = session()->get('login_homeuser');
                $user_id = $user->id;
                $user_name = $user->name;
                $this->assign['user_id'] = $user_id;
                $this->assign['user_name'] = $user_name;

                $model_news = new \App\Model\News();
                $data = $model_news->getNewById($id_news);
                $this->assign['data'] = $data;

                // $model_comments = new \App\Model\Comments();
                // $info = $model_comments->getCommentsByNews_id($id_news);
                // $this->assign['info'] = $info;
                //测试数组的组装
                $model_comments = new \App\Model\Comments();
                $menu_list = $model_comments->getList($id_news);
                
                $this->assign['menu_list'] = $menu_list;

        	return view('home.detailsNews',$this->assign);
	}
}














?>